<%-- 
    Document   : GiuongNam
    Created on : Jun 2, 2014, 3:18:25 AM
    Author     : bienphongvnn
--%>

<%@page import="Data.GiuongNam"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Vị trí giường nằm</title>
        <link id="theme" rel="stylesheet" type="text/css" href="css/dinhdang.css" title="theme" />
        <link id="theme" rel="stylesheet" type="text/css" href="css/style.css" title="theme" />
        <link href="bootstrap-3.1.1-dist/bootstrap-3.1.1-dist/css/bootstrap.css" rel="stylesheet"/>
        <link href="css/carousel.css" rel="stylesheet"/>
        <script src="Js/jquery-2.1.1.js" type="text/javascript"></script>
    </head>
    <script >
        //DoanTau
        $(document).ready(function()
        {

            $.get("DoanTauController",
                    {
                        doantau: "c"
                    },
            function(data, status)
            {
                document.getElementById("doantau").innerHTML = data;
            });
        });
        //ToaTau
        $(document).ready(function()
        {
            $("#btndoantau").click(function()
            {
                $.get("ToaTauController",
                        {
                            toatau: "c"
                        },
                function(data, status)
                {
                    document.getElementById("toatau").innerHTML = data;
                });
            });
        });
        // Gía vé
        $(document).ready(function()
        {
            $("#btndoantau").click(function()
            {
                $.get("GiaVeController",
                        {
                            giave: "c"
                        },
                function(data, status)
                {
                    document.getElementById("giave").innerHTML = data;
                });
            });
        });
        //Chọn phòng
        $(document).ready(function()
        {
            $("#toatau").click(function()
            {
                $.get("PhongController",
                        {
                            phong: "c"
                        },
                function(data, status)
                {
                    document.getElementById("phong").innerHTML = data;
                });
            });
        });
    </script>
    <body>
        <div id="wrapper">
            <div class = "bd" class="lichsu">
                <div id = "page">
                    <div id="container">
                        <!-- Công nghệ bootstrap -->
                        <div id="myCarousel" class="carousel slide" data-ride="carousel">
                            <!-- Indicators -->
                            <ol class="carousel-indicators">
                                <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
                                <li data-target="#myCarousel" data-slide-to="1"></li>
                                <li data-target="#myCarousel" data-slide-to="2"></li>
                            </ol>
                            <!--Hình thứ nhất -->
                            <div class="carousel-inner">
                                <div class="item active">
                                    <img src = "images/railway1.jpg">
                                    <div class="container">
                                        <div class="carousel-caption">
                                            <h1 class="tieude">VNRAILWAY KÍNH CHÀO QUÝ KHÁCH</h1>
                                            <h3>An toàn của bạn là hạnh phúc của chúng tôi!!!</h3>
                                            <p><a class="btn btn-lg btn-primary" href="TrangChu" role="button">Trang chủ</a></p>
                                        </div>
                                    </div>
                                </div>
                                <!--Hình thứ 2 -->
                                <div class="item">
                                    <img src = "images/railway2.jpg">
                                    <div class="container">
                                        <div class="carousel-caption">
                                            <h1 class="tieude">VNRAILWAY KÍNH CHÀO QUÝ KHÁCH</h1>
                                            <h3>Nụ cười của bạn là niềm vui của chúng tôi!!!</h3>
                                            <p><a class="btn btn-lg btn-primary" href="TrangChu" role="button">Trang chủ</a></p>
                                        </div>
                                    </div>
                                </div>
                                <!--Hình thứ 3 -->
                                <div class="item">
                                    <img src = "images/railway3.jpg">
                                    <div class="container">
                                        <div class="carousel-caption">
                                            <h1 class="tieude">VNRAILWAY KÍNH CHÀO QUÝ KHÁCH</h1>
                                            <h3>Luôn luôn lắng nghe, luôn luôn thất vọng</h3>
                                            <p><a class="btn btn-lg btn-primary" href="TrangChu" role="button">TrangChu</a></p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <a class="left carousel-control" href="#myCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
                            <a class="right carousel-control" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
                        </div><!-- /.carousel -->
                        <div class="bd">
                            <div>
                                <h1  class = "lichsu">VỊ TRÍ GIƯỜNG NẰM</h1>
                                <form action="GiuongNamController" method="post">
                                    <table width="350" align="center">
                                        <tr>
                                            <td width ="100" height="40">Đoàn tàu</td>
                                            <td width ="250">
                                                <select id="doantau" name="DoanTau">
                                                    <option></option>
                                                </select>
                                                <button id="btndoantau" type="button">Chọn</button>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td width ="100">Toa tàu</td>
                                            <td width ="100">
                                                <select  id="toatau" name="ToaTau">
                                                    <option></option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td width ="100">Giá vé</td>
                                            <td width ="100">
                                                <select id="giave" name="GiaVe" width="100">
                                                    <option></option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td width ="100">Chọn phòng</td>
                                            <td width ="100">
                                                <select  id="phong" name="Phong">
                                                    <option></option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>Chọn tầng</td>
                                            <td>
                                                <input  type="radio" name="Tang"  value="Tang1" id="Tang1" />
                                                Tầng 1
                                                <input type="radio" name="Tang" value="Tang2" id="Tang2" />
                                                Tầng 2
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td height="40">Chọn vị trí</td>
                                            <td>
                                                <div id="option"></div>
                                                <%
                                                    for (int i = 0; i < 20; i++) {
                                                %>
                                                <a href="#">  <input type="submit" style="height:50px; width: 50px; background-color: crimson; float:left; margin:3px "   name="btnVitri" value ="<%=i%>"<%=i%> id="<%=i%>"<%=i%> > </a>
                                                    <%
                                                        }
                                                    %>

                                            </td>
                                        </tr>
                                    </table>
                                </form>
                                <form action="GioHangGiuongNam.jsp" method="POST">
                                    <table width="350" align="center">
                                        <tr>
                                            <td>&nbsp;</td>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input type ="submit" id="chonvitri" name="chonvitri" value="Chọn vé"/>
                                            </td>
                                            <td>
                                                <input type= "submit" id="chonvitri" name="huychon" value="Hủy đặt vé"/>
                                            </td>
                                        </tr>
                                    </table>
                                </form>
                                <h1  class = "lichsu">DANH SÁCH GIƯỜNG ĐÃ ĐƯỢC ĐẶT</h1>
                                <table width="960" border="1" solid black>
                                    <tr>
                                        <td>STT</td> <td>Số hiệu giường</td> <td>Tình trạng</td> <td>Tầng</td> <td>Mã phòng</td> <td>Mã khách hàng</td> <td>Mã toa</td> <td>Mã tàu</td> <td>Giá vé</td>
                                    </tr>
                                    <%
                                        ArrayList<GiuongNam> arr = Model.GiuongNamModel.ListGiuongNam();
                                        int i = 0;
                                        for (GiuongNam n : arr) {
                                            i++;
                                    %>
                                    <tr>
                                        <td><%= i%></td>
                                        <td><%= n.getSoHieuGiuong()%></td>
                                        <td><%= n.getTrangThai()%></td>
                                        <td><%= n.getTang()%></td>
                                        <td><%= n.getMaPhong()%></td>
                                        <td><%= n.getMaKhachHang()%></td>
                                        <td><%= n.getMaToa()%></td>
                                        <td><%= n.getMaTau()%></td>
                                        <td><%= n.getGiaVe()%></td>
                                    </tr>
                                    <% }%>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="clear"></div>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>	
        <script src="bootstrap-3.1.1-dist/bootstrap-3.1.1-dist/js/bootstrap.min.js"></script>
        <script src="bootstrap-3.1.1-dist/bootstrap-3.1.1-dist/assets/js/docs.min.js"></script>
    </body>
</html>
